#ifndef _OpenNetwork_INCLUDE_COMMON_
#define _OpenNetwork_INCLUDE_COMMON_

/*!
    Copright: Kai "DrHalan" Mast - www.freakybytes.org

    This file is part of OpenNetwork. See OpenNetwork.h for license information.
*/

#ifdef __WINDOWS__
#include <winsock2.h>
#include <Ws2tcpip.h>
#elif defined(__unix__)
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#else
#error "What's your operating system?"
#endif

#include <OpenNetwork/SNetworkAddress.h>

namespace onet
{
    //! Helper functions
    //! Gets the IPv4 / IPv6 adress
    bool getSockAddress6(sockaddr_in6& addr, const SNetworkAddress& netAddr);
    bool getSockAddress(sockaddr_in& addr, const SNetworkAddress& netAddr);

    //! The other way around
    bool getNetworkAddress6(const sockaddr_in6& addr, SNetworkAddress& netAddr);
    bool getNetworkAddress(const sockaddr_in& addr, SNetworkAddress& netAddr);

} //!end namespace onet

#endif
